package com.pantuo.sys.controller;

import com.pantuo.common.utils.TableRequest;
import com.pantuo.common.vo.JsonResult;
import com.pantuo.sys.service.EquipmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageImpl;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/equip")
public class EquipmentController {

    @Autowired
    private EquipmentService equipmentService;

    @RequestMapping("/doFindPageObjects")
    public PageImpl<Map<String, Object>> doFindPageObjects(TableRequest request) {
        System.out.println(request);
        return equipmentService.findPageObjects(request);
    }

    @RequestMapping("/doFindTotalByVId")
    public JsonResult doFindTotalByVId(Integer id) {
        return new JsonResult(equipmentService.findTotalByVId(id));
    }

}
